Learn Red by Ivo Balbaert
Author:Ivo Balbaert
Language: eng
Format: epub
Tags: COM051000 - COMPUTERS / Programming / General, COM051230 - COMPUTERS / Software Development and Engineering / General, COM083000 - COMPUTERS / Security / Cryptography
Publisher: Packt Publishing
Published: 2018-05-18T10:48:37+00:00
The does word
The simplest way to make your own function in Red is with the does word. Consider the following code:
;-- see Chapter06/do-does-has-func.red:
cls: does [ loop 100 [print newline] ] ; == func [][loop 100 [print newline]]
cls ; call function cls
The newline phrase is the character that prints a new line.
In the preceding example, we create a function called cls that clears the output screen by printing 100 blank lines when it is called as cls. It is a function (func), as we can see from the return value when defining cls. You use does when you need a function that has no arguments and no local variables.
=> Now answer question 2 from the Questions section.
An important distinction should be made between the following two kinds of variables:
Local variables, which are only known in the function body itself
Global variables, which are known in the function as well as outside of it
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Effective Threat Investigation for SOC Analysts by Yahia Mostafa;(6767)
Practical Memory Forensics by Svetlana Ostrovskaya & Oleg Skulkin(6480)
Machine Learning Security Principles by John Paul Mueller(6437)
Attacking and Exploiting Modern Web Applications by Simone Onofri & Donato Onofri(6111)
Operationalizing Threat Intelligence by Kyle Wilhoit & Joseph Opacki(6063)
Solidity Programming Essentials by Ritesh Modi(4131)
Microsoft 365 Security, Compliance, and Identity Administration by Peter Rising(3768)
Operationalizing Threat Intelligence by Joseph Opacki Kyle Wilhoit(3512)
Mastering Python for Networking and Security by José Manuel Ortega(3376)
Future Crimes by Marc Goodman(3364)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3352)
Blockchain Basics by Daniel Drescher(3321)
Learn Computer Forensics - Second Edition by William Oettinger(3256)
Incident Response with Threat Intelligence by Roberto MartÃnez(2979)
Building a Next-Gen SOC with IBM QRadar: Accelerate your security operations and detect cyber threats effectively by Ashish M Kothekar(2921)
Mobile App Reverse Engineering by Abhinav Mishra(2899)
Mastering Bitcoin: Programming the Open Blockchain by Andreas M. Antonopoulos(2886)
The Code Book by Simon Singh(2849)
From CIA to APT: An Introduction to Cyber Security by Edward G. Amoroso & Matthew E. Amoroso(2796)
